from enum import IntEnum


DEVTYPE_UNKNOWN = "unknown"
DEVTYPE_OHOS = "ohos"
DEVTYPE_HOS = "hos"
DEVTYPE_KAIHONGOS = "KaihongOS"

DEVSTATE_UNKNOWN = "unknown"
DEVSTATE_ONLINE = "online"
DEVSTATE_OFFLINE = "offline"

class Device:
    def __init__(
        self,
        sn: str,
        type: str = DEVTYPE_OHOS,
        ip: list = [],
        status: str = DEVSTATE_ONLINE,
    ):
        self.sn = sn
        self.type = type
        self.ip = ip
        self.status = status

    def to_dict(self):
        return {
            'sn': self.sn,
            'type': self.type,
            'ip': self.ip,
            'status': self.status
        }
